import collections
import cv2
import numpy as np

filename = '/home/u20/1441/yolo3d/images/0.jpg'
if __name__ == '__main__':
    labelcounter = []
    image = cv2.imread(filename, -1)
    num = image.flatten().tolist()
    labelcounter.extend(num)
    labelcounter = collections. Counter(labelcounter)
    # print(labelcounter)
    b, g, r = cv2.split(image)

    #显示原始图像
    # cv2.imshow("B", b)
    # cv2.imshow("G", g)
    # cv2.imshow("R", r)
    print(b.mean(),r.mean(),b.mean())
    print(b.std(),r.std(),b.std())
    # cv2.waitKey()